home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Add-Ons / MPW / MPW noweb 2.7 / src / perl / noweb < prev    next >
Encoding:
Text File  |  1995-09-05  |  1022 b   |  44 lines  |  [TEXT/MPS ]

  1. Perl -Sx "{0}" {"Parameters"}>"{TempFolder}"noweb.run
  2. "{TempFolder}"noweb.run
  3. Exit
  4.  
  5. #!perl
  6. # Copyright 1991 by Norman Ramsey.  All rights reserved.
  7. # See file COPYRIGHT for more information.
  8.  
  9. $mntopt = "-L";
  10. $tex    = 1;
  11. $output = 1;
  12.  
  13. while ($ARGV[0] =~ /^-/) {
  14.     $arg = shift @ARGV;
  15.     
  16.     if ($arg =~ /^-[ot]+$/) {
  17.         $tex    = 0 if $arg =~ /t/;
  18.         $output    = 0 if $arg =~ /o/;
  19.     } elsif ($arg =~ /^-L/) {
  20.         $mntopt = $arg;
  21.     } elsif ($arg eq "-markup") {
  22.         $markup = shift @ARGV;
  23.     } else {
  24.         die "Unrecognized option $arg"
  25.     }
  26. }
  27.  
  28. $#ARGV > -1 || die "Usage: noweb [-L[fmt] -t -o] file [...]";
  29.  
  30. print "Set Commands \"||LIB||," . $ENV{Commands} ."\"; Export Commands\n;
  31.  
  32. while ($source = shift @ARGV) {
  33.     if ($output) {
  34.         print "markup -t $source | mnt -t3 $mntopt -all\n";
  35.     }
  36.     if ($tex) {
  37.         ($texname = $source) =~ s/\.[^.]*$//;
  38.         $texname .= ".tex";
  39.         print "markup $source | finduses -noquote | noidx -delay |";
  40.         print "perl -pe 's/^@defn \S*$/@literal \\let\\nwnotused=\\nwoutput{}/' |";
  41.         print "totex -delay | cpif $texname\n";
  42.     }
  43. }
  44.